<?php
declare (strict_types = 1);

namespace app\admin\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class Operation extends Model
{
    //
    protected $table = 'lm_operation_group';
    protected $schema = [
        'id' => 'int',
        'name' => 'string',
        'group_leader_id' => 'int',
        'appid' => 'string',
        'key' => 'string',
        'create_time' => 'int',
    ];

    public function getList()
    {
        return Operation::select()->toArray();
    }

    public function checkGroupByName($name) {
        return Operation::where('name', $name)->findOrEmpty();
    }

    public function delGroup($ids) {
        return Operation::destroy($ids);
    }

    public function getInfoById($id) {
        return Operation::findOrEmpty($id)->toArray();
    }


}
